<?php
$_ROOT = include 'root/static/' . $_VAR['pathinfo_extension'] . '.php';
$_ROOT[''] = isset($_GET['root']) ? root_get() : root_cookie();


function root_get()
{
    global $_ROOT;
    setcookie('PHP_ROOT', $_GET['root'], time()+60*60*24*30, '/');
    if (is_numeric($_GET['root'])) {
        return $_GET['root'];
    } elseif ($_GET['root']) {
        $_ROOT['.'] = $_GET['root'];
    }
    
    return '.';
}

function root_cookie()
{
    global $_ROOT;
    $root = isset($_COOKIE['PHP_ROOT']) ? $_COOKIE['PHP_ROOT'] : $_ROOT[''];
    if (!is_numeric($root) && '.' != $root) {
        $_ROOT['.'] = $root;
        $root = '.';
    }
    return $root;
}

return $html = include ROOT . "/{$_ROOT[$_ROOT['']]}.php";
# return false;
# print_r($_SERVER);

